USE DB_TCC
IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE NAME LIKE 'P_REDESOCIAL_LISTAR')
	DROP PROCEDURE P_REDESOCIAL_LISTAR
GO
CREATE PROCEDURE P_REDESOCIAL_LISTAR(
	@DESCREDESOCIAL	VARCHAR(50))
AS BEGIN
	SELECT
		DESCREDESOCIAL,
		ATIVO,
		USUARIOINCLUSAO,
		DTHRINCLUSAO,
		USUARIOALTERACAO,
		DTHRALTERACAO
	FROM
		REDESOCIAL
	WHERE
		(DESCREDESOCIAL = @DESCREDESOCIAL OR CONVERT(VARCHAR(50), @DESCREDESOCIAL) IS NULL)
END